import EventEmitter from 'events'

class FluxTestStore extends EventEmitter {

    constructor() {
        super();
        this.number = 1;
    }

    changeNumber(number) {
        console.log(number);
        let originalNumber = this.number;
        this.number = number + originalNumber;
    }

    getNumber() {
        console.log(this.number);
        return this.number;
    }

    emitChange() {
        this.emit('change')
    }

    addChangeListener(callback) {
        this.on('change', callback)
    }

    removeChangeListener(callback) {
        this.removeListener('change', callback)
    }
}

let fluxTestStore = new FluxTestStore();

export default fluxTestStore;